<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<fmt:setBundle basename="messages" />
		<title><fmt:message key="title"/></title>
		<script type="text/javascript">
   function show()
   {
   document.getElementById("test").style.display="block";
   }
   function save()
   {
   var str=document.getElementById("s").value;
   document.getElementById("orderid").value=str;
   document.getElementById("test").style.display="none";
   }
   </script>
	</head>

	<body>
	<body>
		<table border=1 width="80%" align="center" height="100%">
			<tr>
				<td colspan=2>
					<jsp:include page="header.jsp"></jsp:include>
				</td>
			</tr>
			<tr>
				<td width="20%">
					<jsp:include page="mechnicfunc.jsp"></jsp:include>
				</td>
				<td valign="top">
					<form action="SaveOrderDetails.do" method="post">
						<center>
							<table cellpadding=4 cellspacing=2 border=0>
								<tr>
									<th width="50%">
										Type
									</th>
									<th width="55%">
										Detail
									</th>
								</tr>

								<tr>
									<td>
										Product Number
									</td>
									<td>
										<input type="text" name="partnum" size="15" value="${requestScope.product.productnum}"  readonly >
									</td>
								<tr>
									<td>
										Product Name
									</td>
									<td>
										<input type="text" name=""
											value="${requestScope.product.productname}" size=15
											maxlength=20 disabled>
									</td>
								</tr>
								<tr>
									<td>
										Unit Price
									</td>
									<td>
										<input type="text" name=""
											value="${requestScope.product.unitprice}" size=15
											maxlength=20 disabled>
									</td>
								</tr>
								<tr>
									<td>
										Color
									</td>
									<td>
										<input type="text" name=""
											value="${requestScope.product.color}" size=15 maxlength=20
											disabled>
									</td>
								</tr>
								<tr>
									<td>
										Shelf Location
									</td>
									<td>
										<input type="text" name=""
											value="${requestScope.product.shelflocation}" size=15
											maxlength=20 disabled>
									</td>
								</tr>
								<tr>
									<td>
										Quantity
									</td>
									<td>
									<select id="quantity" name="quantity">
											<c:forEach var="x" begin="1" end="${requestScope.product.instock}" step="1" >
												<option>
											${x }												
												</option>	
												</c:forEach>											
											</select>
								
									</td>
								</tr>
								<tr>
									<td>
										Choose Your Order
									</td>
									<td>
										<input type="text" name="orderid" maxlength=20 size=30 id="orderid"
											onclick="show()">
									</td>
									<td>
										<div id="test" style="display: none">
											<label id="l">
												Order Number
											</label>

											<select id="s" name="ordernum">
											<c:forEach var="order" items="${requestScope.orderList}" varStatus="listpro">
												<option>
												Order Number Is :${order.ordernum }														
												</option>	
												</c:forEach>											
											</select>
											<input type="button" value="Ok" onclick="save();">
										</div>
									</td>
								</tr>
							</table>
						</center>
						<center>
							<br>
							<br>
							<input type="submit" value="Apply">
							<input type="reset" value="Clear">
						</center>
					</form>
				</td>
			</tr>
		</table>
	</body>

</html>
